
cmake_minimum_required(VERSION 3.12)

project(vsg-examples VERSION 0.1)

# 设置C++标准为C++17
# set(CMAKE_CXX_STANDARD 17)

# 添加编译选项以启用多线程支持
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MT ") # 或者使用 /MD

# 消除警告warning 4819
add_compile_options(/wd4819)

# 设置VCPKG_PATH环境变量，三方包查找目录
if(NOT DEFINED ENV{VCPKG_PATH})
    message(FATAL_ERROR "Make sure environment variable:VCPKG_PATH is defined\n"
        "VCPKG_PATH should be the installation directory of vcpkg")
endif()

set(VCPKG_PATH "D:/bylz/projects/vcpkg")
set(CMAKE_TOOLCHAIN_FILE ${VCPKG_PATH}/scripts/buildsystems/vcpkg.cmake)
include(${CMAKE_TOOLCHAIN_FILE})
set(vcpkg_packages_dir ${VCPKG_PATH}/packages)
set(CMAKE_PREFIX_PATH ${vcpkg_packages_dir})

# set(CMAKE_BUILD_TYPE Release)
set(PROJECT_SOURCES src/main.cpp)
add_executable(vsg-examples ${PROJECT_SOURCES})

find_package(Vulkan REQUIRED)
find_package(RapidJSON CONFIG REQUIRED)
find_package(vsg REQUIRED)

# find_package(spdlog CONFIG REQUIRED)
# set(spdlog_dir ${vcpkg_packages_dir}/spdlog_x64-windows)
# target_link_libraries(vsg-examples PRIVATE spdlog::spdlog)
# target_include_directories(vsg-examples PRIVATE ${spdlog_dir})

# set(vulkan_dir ${vcpkg_packages_dir}/vulkan_x64-windows)
# target_link_libraries(vsg-examples PRIVATE Vulkan::Vulkan)
# target_include_directories(vsg-examples PRIVATE ${vulkan_dir}/include)

# set(vsg_dir ${vcpkg_packages_dir}/vsg_x64-windows)
# target_link_libraries(vsg-examples PRIVATE vsg::vsg)
# target_include_directories(vsg-examples PRIVATE ${vsg_dir}/include)
add_subdirectory(external/VulkanSceneGraph)
link_libraries(vsg)
include_directories(external/VulkanSceneGraph/include)
include_directories(external/VulkanSceneGraph/include/core)

# # target_include_directories(vsg-examples PRIVATE external/VulkanSceneGraph/include)
# add_subdirectory(external/vsgXchange)
# link_libraries(vsgXchange)
# include_directories(external/vsgXchange/include)

# add_subdirectory(external/vsgQt)
# link_libraries(vsgQt)
# include_directories(external/vsgQt/include)
